let key = Symbol.for('a');
const obj = {
	name: 'imooc',
	lesson: 'ES6 wiki',
	[key]: 100
}

console.log(Reflect.has(obj, key),
	Reflect.get(obj, key),
	Reflect.set(obj, key, 50),
	Reflect.get(obj, key)
);
console.log(Object.keys(obj),
	Reflect.ownKeys(obj),
	Object.getOwnPropertyNames(obj),
	Object.getOwnPropertySymbols(obj)
);
console.log(Reflect.has(obj, key),
	Reflect.deleteProperty(obj, key),
	Reflect.has(obj, key)
);

let obj2 = {};
console.log(Reflect.defineProperty(obj2, 'age', { value: 17 }),
	obj.age,
	Reflect.getOwnPropertyDescriptor(obj2, 'age')
);

let array = [1, 7, 8, 2, 4, 9, 2, 5];
let string = 'imooc ES6 wiki';
console.log(Reflect.apply(Math.max, null, array),
	Fucntion.prototype.apply.call(Math.max, null, array),
	Math.max.apply(null, array),
	Reflect.apply(String.prototype.slice, str, [6, 9]),
	String.prototype.slice.apply(str, [6, 9])
);

class A {
	constructor(name) {
		this.name = name;
	}
	getName() {
		return this.name;
	}
}
class B {
	constructor(age) {
		this.age = age;
	}
	getAge() {
		return this.age;
	}
}
let a = Reflect.construct(A, []);
let b = Reflect.construct(A, [], B);
console.log(a?.name,
	a?.getName,
	a?.age,
	a?.getAge,
	b?.name,
	b?.getName,
	b?.age,
	b?.getAge
);
console.log(Reflect.getPrototypeOf(a), Reflect.getPrototypeOf(b));

obj = Object.create(null);
console.log(Reflect.getPrototypeOf(obj));
Reflect.setPrototypeOf(obj, Object);
console.log(Reflect.getPrototypeOf(obj));
if (Reflect.isExtensible(obj)) {
	Reflect.preventExtensions(obj);
}
